import facade
from xjlibrary.mLog.mylogger import BaseLogFilter
from xjlibrary.our_file_dir import BaseDir
curPath = BaseDir.get_file_dir_absolute(__file__)

class LogFilter(BaseLogFilter):
    def __init__(self):
        super(LogFilter,self).__init__(name='', logname="_ajax")

    def filter(self, record):
        if record.msg.find("IsAjaxAndJsonData") > -1:
            return True
        else:
            return False


filelogger = facade.get_timerotatingfilelogger(BaseDir.get_new_path(curPath, "logs", "step2"), LogFilter())

filelogger.info("IsAjaxAndJsonData")